<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: Dstar</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: Dstar</td>
      <td class="subheader-left"><a href="matlab:open Dstar">View code for Dstar</a></td>
    </tr>
  </table>
<h1>Dstar</h1><p><span class="helptopic">D* navigation class</span></p><p>
A concrete subclass of the abstract Navigation class that implements the D*
navigation algorithm.  This provides minimum distance paths and
facilitates incremental replanning.

</p>
<h2>Methods</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> Dstar</td> <td>Constructor</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> plan</td> <td>Compute the cost map given a goal and map</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> query</td> <td>Find a path</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> plot</td> <td>Display the obstacle map</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> display</td> <td>Print the parameters in human readable form</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> char</td> <td>Convert to string%  costmap_modify    Modify the costmap</td></tr>
  <tr></tr>
  <tr></tr>  <tr><td style="white-space: nowrap;" class="col1"> modify_cost</td> <td>Modify the costmap</td></tr>
</table>
<h2>Properties (read only)</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> distancemap</td> <td>Distance from each point to the goal.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> costmap</td> <td>Cost of traversing cell (in any direction).</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> niter</td> <td>Number of iterations.</td></tr>
</table>
<h2>Example</h2>
<pre style="width: 90%%;" class="examples">
load&nbsp;map1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&nbsp;load&nbsp;map
goal&nbsp;=&nbsp;[50,30];
start=[20,10];
ds&nbsp;=&nbsp;Dstar(map);&nbsp;&nbsp;&nbsp;&nbsp;%&nbsp;create&nbsp;navigation&nbsp;object
ds.plan(goal)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&nbsp;create&nbsp;plan&nbsp;for&nbsp;specified&nbsp;goal
ds.query(start)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&nbsp;animate&nbsp;path&nbsp;from&nbsp;this&nbsp;start&nbsp;location
</pre>
<h2>Notes</h2>
<ul>
  <li>Obstacles are represented by Inf in the costmap.</li>
  <li>The value of each element in the costmap is the shortest distance from the
corresponding point in the map to the current goal.</li>
</ul>
<h2>References</h2>
<ul>
  <li>The D* algorithm for real-time planning of optimal traverses,
A. Stentz,
Tech. Rep. CMU-RI-TR-94-37, The Robotics Institute, Carnegie-Mellon University, 1994.
https://www.ri.cmu.edu/pub_files/pub3/stentz_anthony__tony__1994_2/stentz_anthony__tony__1994_2.pdf</li>
  <li>Robotics, Vision & Control, Sec 5.2.2,
Peter Corke, Springer, 2011.</li>
</ul>
<h2>See also</h2>
<p>
<a href="Navigation.html">Navigation</a>, <a href="DXform.html">DXform</a>, <a href="PRM.html">PRM</a></p>
<hr>
<a name="Dstar"><h1>Dstar.Dstar</h1></a>
<p><span class="helptopic">D* constructor</span></p><p>
<strong>ds</strong> = <span style="color:red">Dstar</span>(<strong>map</strong>, <strong>options</strong>) is a D* navigation object, and <strong>map</strong> is an
occupancy grid, a representation of a planar world as a
matrix whose elements are 0 (free space) or 1 (occupied).
The occupancy grid is coverted to a costmap with a unit cost
for traversing a cell.

</p>
<h2>Options</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1">'goal', G</td> <td>Specify the goal point (2x1)</td></tr>
  <tr><td style="white-space: nowrap;" class="col1">'metric', M</td> <td>Specify the distance metric as 'euclidean' (default)
or 'cityblock'.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1">'inflate', K</td> <td>Inflate all obstacles by K cells.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'progress'</td> <td>Don't display the progress spinner</td></tr>
</table>
<p>
Other options are supported by the Navigation superclass.

</p>
<h2>See also</h2>
<p>
<a href="Navigation.Navigation.html">Navigation.Navigation</a></p>
<hr>
<a name="char"><h1>Dstar.char</h1></a>
<p><span class="helptopic">Convert navigation object to string</span></p><p>
DS.<span style="color:red">char</span>() is a string representing the state of the <span style="color:red">Dstar</span>
object in human-readable form.

</p>
<h2>See also</h2>
<p>
<a href="Dstar.display.html">Dstar.display</a>, <a href="Navigation.char.html">Navigation.char</a></p>
<hr>
<a name="modify_cost"><h1>Dstar.modify_cost</h1></a>
<p><span class="helptopic">Modify cost map</span></p><p>
DS.<span style="color:red">modify_cost</span>(<strong>p</strong>, <strong>C</strong>) modifies the cost map for the points described by
the columns of <strong>p</strong> (2xN) and sets them to the corresponding elements of <strong>C</strong>
(1xN).  For the particular case where <strong>p</strong> (2x2) the first and last columns
define the corners of a rectangular region which is set to <strong>C</strong> (1x1).

</p>
<h2>Notes</h2>
<ul>
  <li>After one or more point costs have been updated the path
should be replanned by calling DS.plan().</li>
</ul>
<h2>See also</h2>
<p>
<a href="Dstar.set_cost.html">Dstar.set_cost</a></p>
<hr>
<a name="plan"><h1>Dstar.plan</h1></a>
<p><span class="helptopic">Plan path to goal</span></p><p>
DS.<span style="color:red">plan</span>(<strong>options</strong>) create a D* <span style="color:red">plan</span> to reach the goal from all free cells
in the map.  Also updates a D* <span style="color:red">plan</span> after changes to the costmap. The
goal is as previously specified.

</p>
<p>
DS.<span style="color:red">plan</span>(<strong>goal</strong>,<strong>options</strong>) as above but goal given explicitly.

</p>
<h2>Options</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> 'animate'</td> <td>Plot the distance transform as it evolves</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'progress'</td> <td>Display a progress bar</td></tr>
</table>
<h2>Note</h2>
<ul>
  <li>If a path has already been planned, but the costmap was
modified, then reinvoking this method will replan,
incrementally updating the plan at lower cost than a full
replan.</li>
  <li>The reset method causes a fresh plan, rather than replan.</li>
</ul>
<h2>See also</h2>
<p>
<a href="Dstar.reset.html">Dstar.reset</a></p>
<hr>
<a name="plot"><h1>Dstar.plot</h1></a>
<p><span class="helptopic">Visualize navigation environment</span></p><p>
DS.<span style="color:red">plot</span>() displays the occupancy grid and the goal distance
in a new figure.  The goal distance is shown by intensity which
increases with distance from the goal.  Obstacles are overlaid
and shown in red.

</p>
<p>
DS.<span style="color:red">plot</span>(<strong>p</strong>) as above but also overlays a path given by the set
of points <strong>p</strong> (Mx2).

</p>
<h2>See also</h2>
<p>
<a href="Navigation.plot.html">Navigation.plot</a></p>
<hr>
<a name="reset"><h1>Dstar.reset</h1></a>
<p><span class="helptopic">Reset the planner</span></p><p>
DS.<span style="color:red">reset</span>() resets the D* planner.  The next instantiation
of DS.plan() will perform a global replan.

</p>
<hr>
<a name="set_cost"><h1>Dstar.set_cost</h1></a>
<p><span class="helptopic">Set the current costmap</span></p><p>
DS.<span style="color:red">set_cost</span>(<strong>C</strong>) sets the current costmap.  The cost map is the same size
as the occupancy grid and the value of each element represents the cost
of traversing the cell.  A high value indicates that the cell is more costly
(difficult) to traverese.  A value of Inf indicates an obstacle.

</p>
<h2>Notes</h2>
<ul>
  <li>After the cost map is changed the path should be replanned by
calling DS.plan().</li>
</ul>
<h2>See also</h2>
<p>
<a href="Dstar.modify_cost.html">Dstar.modify_cost</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2014 Peter Corke.</p>
</body></html>